<%@page import="org.springframework.scheduling.annotation.Scheduled"%>
<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String username = user.getUsername();
	String siteName = user.getSiteName();
	DutyForm form = (DutyForm) request.getAttribute("command");
	String siteId = form.getSiteId();
	String deptId = form.getDeptId();
%>

<style>
	.selectHour-split{
		padding:0 2px;
		margin-right:5px;	
	}
	.selectMinute-split{
		padding:0 2px;
	}
</style>

<div>
	<form id="addSchedule" target="_coreIframe" method="post" action="<%=request.getContextPath()%>/duty/doAddSchedule" 
		name="addSchedule" enctype="multipart/form-data">
		<div class="breadcrumb">
			<div class="bcIcon"></div>
			<ul class="bcNav">
				<li>增加值班班次管理</li>
			</ul>
		</div>
		<table class="formTable">
			<tr>
				<td class="tdTitle">所属公司：</td>
				<td>
					<select id="siteList" class="easyui-combobox" name="siteId" style="width:100px;"></select>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">部门：</td>
				<td>
					<select id="deptList" class="easyui-combobox" name="deptId" style="width:100px;"></select>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">班次名称：</td>
				<td>
					<input class="inputText xxs" type="text"  value="" name="scheduleName" 
						style="width:100px;" placeholder="请设置班次名称">
				</td>
			</tr>
			<tr>
				<td class="tdTitle">开始时间：</td>
				<td>
					<input class="inputText xxs" type="text"  value="" name="startTime" placeholder="请设置班次开始时间(如：8:00)">
				</td>
			</tr>
			<tr>
				<td class="tdTitle">结束时间：</td>
				<td>
				<input class="inputText xxs" type="text"  value="" name="endTime" placeholder="请设置班次结束时间(如：18:00)">
				</td>
			</tr>
			<tr>
				<td class="tdTitle">部门电话：</td>
				<td>
					<input class="inputText xxs" type="text"  value="" name="deptTelNo" placeholder="请设置部门联系电话">
				</td>
			</tr>
			<tr>
				<td class="tdTitle"></td>
				<td>
					<div>
						<input class="input-btn-microsoft" type="submit" value="提交">
						<a class="a-btn-microsoft" href="javascript:XF.Duty.manageSchedule()">取消</a>
					</div>
				</td>
			</tr>
		</table>
		<input type="hidden" value="<%=siteId %>" name="siteId">
		<input type="hidden" value="<%=deptId %>" name="deptId">
	</form>
	<iframe id="_coreIframe" name="_coreIframe" style="display: none;"></iframe>
</div>

<script>
$('#siteList').combobox({
	/* url:global.contextPath + '/company/siteList',
	method:'get', */
	valueField:'siteid',
	textField:'sitename',
	disabled:true,
	required:true
});

$('#deptList').combobox({
	url:global.contextPath + '/duty/datagridDepts?siteId=' + '<%=siteId%>',
	valueField:'deptId',
	textField:'deptName',
	method:'get',
	required: true,
	disabled:true,
	panelHeight: '300',
});
$('#siteList').combobox('setValue', '<%=siteId%>');
$('#siteList').combobox('setText', '<%=user.getSiteName()%>');
$('#deptList').combobox('setValue', '<%=deptId%>');
</script>
